from flask import (Blueprint, request)
from json import (dumps)
from msg import condition
from mylog import LOG
from service.see_service import (get_d_m_c_service,
                                 get_today_calls_service)


see = Blueprint("see", __name__, url_prefix="/see")


@see.route("/get_d_m_c", methods=('post', 'get'))
def get_d_m_c():
    d_m_j = get_d_m_c_service()
    # print(d_m_j)
    res = condition["200_1"]
    res["data"] = d_m_j
    return dumps(res)


@see.route("/get_today_calls", methods=('post', 'get'))
def get_today_calls():
    data = request.json
    calls = get_today_calls_service(data)
    res = condition["200_1"]
    res["data"] = calls
    return res